package com.sc.syllabus.work_hours.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.litesuits.orm.db.annotation.Column;
import com.litesuits.orm.db.annotation.NotNull;
import com.srain.utils.db.BaseTable;

/**
 * Created by liushuanglong on 2017/9/12.
 * <p>
 * 工时
 */
public class WorkHoursBean extends BaseTable implements Parcelable {

    @Column("startAt")
    private long startAt; // 开始时间

    @Column("endAt")
    private long endAt; // 结束时间

    @NotNull
    @Column("workAddress")
    private int workAddress; // 0.耐拓 , 1.家 ,3.其他

    @Column("worContent")
    private String workContent; // 工作内容

    public WorkHoursBean() {
    }

    protected WorkHoursBean(Parcel in) {
        _id = in.readLong();
        startAt = in.readLong();
        endAt = in.readLong();
        workAddress = in.readInt();
        workContent = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(_id);
        dest.writeLong(startAt);
        dest.writeLong(endAt);
        dest.writeInt(workAddress);
        dest.writeString(workContent);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<WorkHoursBean> CREATOR = new Creator<WorkHoursBean>() {
        @Override
        public WorkHoursBean createFromParcel(Parcel in) {
            return new WorkHoursBean(in);
        }

        @Override
        public WorkHoursBean[] newArray(int size) {
            return new WorkHoursBean[size];
        }
    };

    public long getStartAt() {
        return startAt;
    }

    public void setStartAt(long startAt) {
        this.startAt = startAt;
    }

    public long getEndAt() {
        return endAt;
    }

    public void setEndAt(long endAt) {
        this.endAt = endAt;
    }

    public int getWorkAddress() {
        return workAddress;
    }

    public void setWorkAddress(int workAddress) {
        this.workAddress = workAddress;
    }

    public String getWorkContent() {
        return workContent;
    }

    public void setWorkContent(String workContent) {
        this.workContent = workContent;
    }

    public String toString() {
        String str = "";
        str += "\n\nID = " + this._id;
        str += "\nStrartTime = " + this.startAt;
        str += "\nEndTime = " + this.endAt;
        str += "\nAddress = " + this.workAddress;
        str += "\nWorkContent = " + this.workContent;
        return str;
    }
}
